<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<% String path = request.getContextPath(); %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Java Web学习</title>
<link rel="stylesheet" type="text/css" href="<%=path %>/css/index.css">
</head>
<body>
	<div class="dropdown" style="float: left;">
		<button class="dropbtn">Servlet技术</button>
		<div class="dropdown-content" style="left: 0;">
			<a onclick="setUrl('/jsp/index.jsp')" href="#">First Servlet配置</a> 
		</div>
	</div>
	<div class="dropdown" style="float: left;">
		<button class="dropbtn">JSP技术</button>
		<div class="dropdown-content">
			<a onclick="setUrl('/jsp/timeinfo.jsp')" href="#">jsp脚本元素</a> 
			<a onclick="setUrl('/jsp/includeweb/index2/index.jsp')" href="#">&lt;jsp:include&gt;</a> 
			<a onclick="setUrl('/jsp/includeweb/index/index.jsp')" href="#">&lt;%@include&gt;</a> 
		</div>
	</div>
	<div class="dropdown" style="float: left;">
		<button class="dropbtn">会话及会话技术</button>
		<div class="dropdown-content">
			<a onclick="setUrl('/lastAccessServlet')" href="#">Cookie</a> 
			<a onclick="setUrl('/indexServlet')" href="#">Session</a> 
		</div>
	</div>
	<div class="dropdown" style="float: left;">
		<button class="dropbtn">JavaBean和MVC</button>
		<div class="dropdown-content">
			<a onclick="setUrl('/jsp/javabean/index.jsp')" href="#">JavaBean种类</a> 
			<a onclick="setUrl('/jsp/javabean/stuInfo.jsp')" href="#">JavaBean应用1</a> 
			<a onclick="setUrl('/jsp/javabean/stuInfo2.jsp')" href="#">JavaBean应用2</a> 
			<a onclick="setUrl('/jsp/javabean/bookadd.jsp')" href="#">图书添加案例</a> 
			<a onclick="setUrl('/jsp/javabean/email.jsp')" href="#">解决中文乱码案例</a> 
			<a onclick="setUrl('/jsp/javabean/login.jsp')" href="#">判断用户名是否有效</a> 
		</div>
	</div>
	<div style="width: 100%;display: flex;">
		<iframe onload="SetCwinHeight()" id="bobo" style="width: 100%;" frameborder="0" scrolling="no" src="<%=path%>/content.jsp" allowtransparency="true"></iframe>
	</div>
	 <script type="text/javascript">
	 function setUrl(url){	
		 document.getElementById('bobo').src = '<%=path%>'+url;
	 }
	 function SetCwinHeight(){
		var bobo=document.getElementById("bobo"); //iframe id
		if (document.getElementById){ 
			if (bobo && !window.opera){   
				if (bobo.contentDocument && bobo.contentDocument.body.offsetHeight){  
					bobo.height = bobo.contentDocument.body.offsetHeight+20;  
				}else if(bobo.Document && bobo.Document.body.scrollHeight){ 
					bobo.height = bobo.Document.body.scrollHeight+20;    
				}  
			}
		 }
	}
	</script> 
</body>
</html>